package com.mojo.concurrent.concurrent_01_thread;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

/**
 * 线程基础-查看普通java程序包含哪些线程
 *
 * @author <a href="mailto:sjj@jianzhimao.com">mojo</a>
 * copyright (C), 2013-2023, 广州九尾信息科技有限公司
 * @date 2023/1/30 17:47
 */
public class MultiThread {
    public static void main(String[] args) {
        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(false, false);
        for (ThreadInfo t : threadInfos) {
            System.out.println(t.getThreadId() + ">>>" + t.getThreadName());
        }
    }
// 6>>>Monitor Ctrl-Break
// 5>>>Attach Listener
// 4>>>Signal Dispatcher
// 3>>>Finalizer
// 2>>>Reference Handler
// 1>>>main
}
